<template>
	<el-drawer title="项目预算详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="预算标题" prop="title">{{form.title}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="关联项目" prop="proId">{{form.proTitle}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="费用类型" prop="costId">{{form.costTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="预算金额" prop="funds">{{form.funds}}/元
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="预算说明" prop="remark">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="form.attachRole" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				recordId: '',
				proTitle:"",
				sortNo:0,
				title: "",
				costTypeName: '',
				funds: 0,
				remark: '',
				attachId: '',
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.title = data.title
			this.form.sortNo = data.sortNo
			this.form.proTitle = data.proTitle
			this.form.sortNo = data.sortNo
			this.form.costTypeName = data.costTypeName
			this.form.funds = data.funds
			this.form.remark = data.remark
			this.form.attachId = data.attachId
		},
	}
}
</script>

<style>
</style>
